package com.jm.offer.easy;

/**
 * @Description https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/
 * @date 2022/5/2 8:03
 */
public class _58_II左旋转字符串 {

    public static void main(String[] args) {
       String s = "lrloseumgh" ;
       int k = 6;
        System.out.println(reverseLeftWords(s, k));
    }

    public static String reverseLeftWords(String s, int n) {
        StringBuilder stringBuilder = new StringBuilder(s);
        StringBuilder stringBuilder2 = new StringBuilder(s);
        // 获取前 n 位
        stringBuilder.setLength(n);
        stringBuilder2.delete(0,n);
        stringBuilder2.append(stringBuilder);
        return stringBuilder2.toString();
    }
}
